
<?php 
if ($this->pager->getResultsInPage()) :

echo $this->form('products_list', array(
            'action' => $this->url(array(), 'Products'), 
            'method' => Zend_Form::METHOD_GET
            ), $this->formSubmit('submit', 'Добавить'));
    echo $this->form('products_delete', array(
            'action' => $this->url(array(), 'ProductsDelete'), 
            'method' => Zend_Form::METHOD_POST
            ), false);
    echo $this->formSubmit('submit', 'Удалить');
?>

<?=$this->partial('db/_alphabet.phtml', array('alphabet' => $this->alphabet))?>

<table id="content">
    <tr class="head">
        <td colspan="2">Продукт</td>
        <?php 
        foreach($this->components as $code => $name) :
            ?><td><?=$name?></td><?php
        endforeach; 
        ?>
    </tr>
    <?php
    
    foreach ($this->pager->execute() as $product) :
    ?><tr id="<?=$product['id']?>" class="<?php if($this->id == $product['id']) :?>active <?php endif;?><?php echo $this->cycle(array('odd', 'even'))->next(); ?>"><?php
        ?><td><?=$this->formCheckbox('delete[' . $product['id'] . ']', 1)?></td><?php
        ?><td><?=$product['name']?></td><?php
        foreach ($product['Content'] as $component) {
            ?><td><?=$component['value']?></td><?php
        }
    ?></tr><?php
    endforeach;
    
    ?>
</table>
</form>

<div class="pages">
    <?=$this->pagination($this->pager_range, $this->pager->getPage())?>
</div>
<?php
endif;
?>